from django.db import models

from prj002.models.models import CreatTimeModel
from prj002.models.info import Info
from myuser.models import MyUser


class Standard(CreatTimeModel):

    info = models.OneToOneField(Info, on_delete=models.CASCADE, related_name='standard')

    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj002_standard')

    CLINICAL_STANDARD_CHOICES = (
        ('1', 'Rotterdam的诊断标准'),
        ('2', '2018年多囊卵巢综合征中国诊疗指南的诊断标准')
    )
    clinical_standard = models.CharField(max_length=4, choices=CLINICAL_STANDARD_CHOICES, blank=True, null=True, verbose_name='(一)诊断标准', help_text='(一)诊断标准')

    china_standard_choices = (
        ('1', '育龄期PCOS的诊断'),
        ('2', '青春期PCOS的诊断')
    )
    china_standard = models.CharField(max_length=4, choices=CLINICAL_STANDARD_CHOICES, blank=True, null=True, verbose_name='(二)诊断标准', help_text='(二)诊断标准')

    rotterdam_one = models.BooleanField(blank=True, default=False, verbose_name='Rotterdam的诊断标准-1', help_text='Rotterdam的诊断标准-1')
    rotterdam_two = models.BooleanField(blank=True, default=False, verbose_name='Rotterdam的诊断标准-2', help_text='Rotterdam的诊断标准-2')
    rotterdam_three = models.BooleanField(blank=True, default=False, verbose_name='Rotterdam的诊断标准-3', help_text='Rotterdam的诊断标准-3')

    pcos_one = models.BooleanField(blank=True, default=False, verbose_name='育龄期PCOS的诊断-1', help_text='育龄期PCOS的诊断-1')
    pcos_two_a = models.BooleanField(blank=True, default=False, verbose_name='育龄期PCOS的诊断-2a', help_text='育龄期PCOS的诊断-2a')
    pcos_two_b = models.BooleanField(blank=True, default=False, verbose_name='育龄期PCOS的诊断-2b', help_text='育龄期PCOS的诊断-2b')

    def __str__(self):
        return '%s-%s' % (self.pk, self.info)

    class Meta:
        verbose_name = '评判标准'
        verbose_name_plural = verbose_name
